﻿using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Sprites;
using UnityEngine.EventSystems;
using System.Collections;

public class UIButtonExt : MonoBehaviour , IPointerDownHandler , IPointerUpHandler {


	public Sprite buttonPressImage;

	private Image buttonImage;
	private Sprite buttonNormalImage;

	void Start () {
		buttonImage = GetComponent<Button> ().GetComponent<Image>();
		buttonNormalImage = buttonImage.sprite; 
	}
 

	public void OnPointerDown(PointerEventData eventData) {
		buttonImage.sprite = buttonPressImage;
	}

	public void OnPointerUp(PointerEventData eventData) {
		buttonImage.sprite = buttonNormalImage;
	}

}
